package com.demo.alibaba.util;

import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.function.BinaryOperator;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.stream.Collectors;

/**
 * Created by yangshunxing on 2017/3/7.
 */
public class EnumLamdaTest {

    public static void main(String[] args) throws Exception {
        String areaCode = "110000,120000,140000,150000,210000,320000,330000,340000,350000,370000,420000,430000,440000,500000,510000,520000,530000,650000,990000";
        List<String> areaString = Arrays.asList(areaCode.split(","));
        List<String> areaList = areaString.stream().map(code -> Area.getAreaByCode(Integer.parseInt(code))).collect(Collectors.toList());
        String result = "";
        for (String s: areaList){
            result+=s+",";
        }
        /*areaString.forEach(i -> System.out.println(i));
        System.out.println(result);*/

       /* Predicate<Integer> atLeast5 = x -> x == 5;
        System.out.println(atLeast5.test(5));*/

     /*   BinaryOperator<Double> addLongs = (x,y) -> x+y;
        System.out.println(addLongs);*/

        Proxy target = new Proxy();
        Method method = Proxy.class.getDeclaredMethod("run");
        method.invoke(target);

    }

    static class Proxy {
        public void run() {
            System.out.println("run");
        }
    }
}
